#ifndef _CHECK_VS_TOK_
#define _CHECK_VS_TOK_
#include "../DF_Common/basis_state.h"
#include "../DF_Common/package.h"
#include "../DF_Mpi_Sep/cont_term.h"
#include "../DF_Mpi_Sep/ope_term.h"
#include "../DF_Mpi_Sep/tpe_term.h"
#include "../DF_Mpi_Sep/trans_coeff.h"
#include "../DF_Mpi_Sep/antisym_coeff.h"
#include <iostream>
#include <fstream>
#include <string>
#include <vector>


using std::string;
using std::vector;


struct TP_Tok
{
  int channel;
  int T_2;
  int J_2;
  int index;
};
struct T_state_Tok{
  int index_TP;
  int ch_TP;
  int ch_NL;
  int N0;
  int L0;
  int index_NL;
  int index_jac;
  int i;
  int p;
  double T_tok;
  int flag;
};
struct Tpe_struct{
  int p;
  int q;
  double C1;
  double C3;
  double C4;
};

class CheckVsT{
public:
  CheckVsT()=default;
 CheckVsT(int J2_x,int T2_x,Jacobi &jaco_t):J2(J2_x),T2(T2_x),jaco_b(jaco_t){}
  //SingleP &SP;
  Jacobi jaco_b;
  //Jacobi_NL &jacNL;

  vector<int> z2t;
  vector<int> t2z;
  int J2,T2;
  int channel;
  int channel_jac;
  vector<State_Jacobi> jaco_t;
  vector<TP_Tok> TP_tok;
  vector<T_state_Tok> T_tok;
  vector<Tpe_struct> Tpe_tok_vec;
  void read_Tok(std::string filename,int J2_t,int T2_t);
  void match(Jacobi &Jacobi_t);
  void read_Tok_TP(std::string filename,SingleP &SP,TripleP &TP);
  void read_Tok_T(std::string filename_jac, Jacobi_NL &jacNL, int T_2);

  void read_Tok_tpe(std::string filename,int J2_t,int T2_t);

  void check_cont(Cont_term &cont_x, int J2_t,int T2_t);

  void check_cont(Cont_term &cont_x, int J2_t,int T2_t, string filename);
  void check_ope(Ope_term &ope_x, int J2_t,int T2_t);
  void check_ope(Ope_term &ope_x, int J2_t,int T2_t, string filename);

  void check_tpe(Tpe_term &tpe_x, int J2_t,int T2_t);

  void check_JacA_vec(Package &pack, string filename);
  void check_Dcoeff(Jacobi &jaco_b, Antisym &antisym_t, string filename);

  void check_Tcoeff(TripleP &triple_t, Jacobi_NL &jaco_nl, TransCoeff &trans_t, string filename);

  void check_pack(Package &pack, string filename);

};



#endif
